// app.js
App({
    onLaunch() {
        this.getBottomHeight();
    },
    getBottomHeight: function () {
        let menuButtonObject = wx.getMenuButtonBoundingClientRect()
        wx.getSystemInfo({
            success: res => {
                let statusBarHeight = res.statusBarHeight;
                let navHeight = statusBarHeight + menuButtonObject.height + (menuButtonObject.top - statusBarHeight) * 2;
                this.globalData.bottomHeight = res.screenHeight - res.safeArea.bottom; //底部距离
                this.globalData.navTop = res.safeArea.top;
                this.globalData.navHeight = navHeight;
                this.globalData.statusBarHeight = statusBarHeight;
            },
            fail(err) {
                console.log(err);
            }
        })
    },
    globalData: {
        navTop: "", //顶部部距离兼容
        bottomHeight: "", //iPhone底部距离兼容
        statusBarHeight:"",
        userInfo: null,
    }
})